package com.jianganming.nio.reactor;

import java.nio.channels.SocketChannel;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

//支持多个连接
public class MutilDispatchHandler implements Runnable {
    private SocketChannel channel;

    private Executor executor = Executors.newFixedThreadPool(5);

    public MutilDispatchHandler(SocketChannel channel) {
        this.channel = channel;
    }

    @Override
    public void run() {
        executor.execute(new Handler(channel));
    }
}
